<?php

namespace App\Model;

use Carbon\Carbon;
use DateTimeInterface;
use Illuminate\Database\Eloquent\Model;

class BaseModel extends Model
{
  protected function serializeDate(DateTimeInterface $date)
  {
      return Carbon::instance($date)->toDateTimeString();//这里使用toDateTimeString，不受Carbon中时区的影响
  }
}
